package com.order.controller;
 
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.order.service.OrderService;
import com.order.uitl.BaseRespons;

import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;

@RestController
@RequestMapping("/order")
@Slf4j
public class OrderController {
	 
	@Autowired
    private OrderService orderService;
	
	
	@ApiOperation(value = "MQ方式调用-用户下单")
	@PostMapping("/orderMQSend")
	public BaseRespons orderMQSend() {
		BaseRespons b =new BaseRespons();
		orderService.saveMQOrder();
		b.setState(1);
		b.setMsg("发送成功");
		return b;
	}
	@ApiOperation(value = "接口方式调用-用户下单")
	@PostMapping("/orderSend")
	public BaseRespons orderSend() {
		return orderService.saveOrder();
	}
}
